<?php
//require 'config.php';
$fromfolder = 'media/upload/editor';
$filename = $_REQUEST["filename"];
$location_id = 1;

if (empty($fromfolder) || empty($filename) || count(explode("..", $filename)) > 1)
{
    echo "miss parame.";
    die;
}
$a_file = explode(",", $filename);
$dir_root = dirname(__FILE__);
$fromfolder = $dir_root . "/" . $fromfolder."/e_".$location_id;
try {
    if(!empty($a_file)){
        foreach($a_file as $file){
           unlink($fromfolder . "/" . $file);
        }
    }
} catch (Exception $e) {
    echo "error:" . DIRECTORY_SEPARATOR;
    die;
}
echo "success";
die;
?>